package com.carrier.springboot.common.vo;

import java.io.Serializable;

import com.alibaba.fastjson.JSON;
 
/**
 * 
    * @ClassName: RestResult
    * @Description: TODO(这里用一句话描述这个类的作用)
    * @author Carrier
    * @date 2018年9月12日
    *
    * @param <T>
 */
public class RestResult<T> implements Serializable {

	private static final long serialVersionUID = 3758864789222317092L;

	public int code;

	private String msg;

	private T data;

	public RestResult<T> setCode(RestCode retCode) {
		this.code = retCode.code;
		return this;
	}

	public int getCode() {
		return code;
	}

	public RestResult<T> setCode(int code) {
		this.code = code;
		return this;
	}

	public String getMsg() {
		return msg;
	}

	public RestResult<T> setMsg(String msg) {
		this.msg = msg;
		return this;
	}

	public T getData() {
		return data;
	}

	public RestResult<T> setData(T data) {
		this.data = data;
		return this;
	}

	@Override
	public String toString() {
		return JSON.toJSONString(this);
	}
}